package homework.demo1;

import java.lang.reflect.Method;

public class Demo {
    public static void main(String[] args) throws Exception{
        User user = new User();
        user.sayHello();

        Class<?> cls = Class.forName("homework.demo1.User");
        Object obj = cls.newInstance();
        Method method = cls.getMethod("sayHello");
method.invoke(obj);

    }
}
